package com.game.controllers;

import com.game.objects.Enemy;
import com.game.system.Game;
import com.jme.math.Vector3f;

public class DefaultEnemyController extends EnemyController{

	Vector3f direction;
	
	public DefaultEnemyController(Enemy enemy) {
		super(enemy);
		
	}

	@Override
	public void update(float time) {
		super.update(time);
		enemy.getEnemy().lookAt(Game.getGameLogic().getPlayer().getPlayer().getWorldTranslation(), Vector3f.UNIT_Y);
		this.direction =  enemy.getEnemy().getLocalRotation().getRotationColumn(2).normalize();
		enemy.getEnemy().getLocalTranslation().addLocal(direction.mult(time * enemy.getSpeed()));
	}

}
